package argo.hot100.special;

public class MajorityElement {

    public int majorityElement(int[] nums) {
        int condidate = 0, count = 0;

        for (int num : nums) {
            if (count <= 0) {
                condidate = num;
            }
            if (condidate == num) {
                count++;
            } else {
                count--;
            }
        }
        return condidate;
    }
}
